<?php
/*
Template Name: Sitemap
*/

$meta=get_post_custom($post->ID);
?>

<?php get_header(); ?>

<?php get_sidebar(); ?>

<div id="right" class="t-page">
	
	<?php while(have_posts()): the_post(); ?>
	
	<div id="content">
		<div id="content-inner">
			<div id="content-pad">
			
			<div id="grid-wrap">
				<div class="grid-4">
					<article id="entry-<?php the_ID(); ?>" <?php post_class('entry'); ?>>
						<header class="page">
							<h1 class="entry-title"><?php the_title(); ?></h1>
						</header>
						<div class="text clearfix">
							<?php the_content(); ?>
							
							<div id="sitemap-wrap">
								<h3>Pages</h3>
								<ul><?php wp_list_pages("title_li=" ); ?></ul>
								
								<h3>Feeds</h3>
								<ul>
									<li><a title="Full content" href="feed:<?php bloginfo('rss2_url'); ?>">Main RSS</a></li>
									<li><a title="Comment Feed" href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comment Feed</a></li>
								</ul>
								
								<h3>Categories</h3>
								<ul><?php wp_list_categories('sort_column=name&optioncount=1&hierarchical=0&feed=RSS&title_li='); ?></ul>

								<h3>Archives</h3>
								<ul>
									<?php wp_get_archives('type=monthly&show_post_count=true'); ?>
								</ul>
								
								<h3>All Blog Posts:</h3>
								<ul><?php $archive_query = new WP_Query('showposts=1000&cat=-8');
								while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
									<li>
										<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
										(<?php comments_number('0', '1', '%'); ?>)
									</li>
								<?php endwhile; ?>
								</ul>
							</div>
							
							<div class="clear"></div>
							<?php edit_post_link( __('Edit','creatic'), ' &#183; ', ''); ?>
						</div>
					</article>

					<?php if(bandit::comments_enabled() || have_comments()): ?>
					<div id="entry-comments">
						<?php comments_template(); ?>
					</div>
					<?php endif; ?>
					<?php endwhile;?>
				</div><!--end grid-4-->
			</div><!--end grid-wrap-->
			
			<div class="clear"></div>
			</div><!--end content-pad-->
			<?php get_template_part('footer-widgets'); // footer-widgets.php ?>
		</div><!--end content-inner-->
		<div class="clear"></div>
	</div><!--end content-->
	
</div><!--end right-->

<?php get_footer(); ?>